<template>
  <el-table :data="tableData" style="width: 100%">
    <el-table-column fixed label="角色ID" prop="id" width="150" />
    <el-table-column label="角色名称" prop="name" width="300" />
    <el-table-column label="角色编码" prop="code" width="120" />
    <el-table-column label="角色状态" prop="status" width="120" />
    <el-table-column label="排序" prop="sort" width="120" />
    <el-table-column label="更新时间" prop="updateTime" width="220" />
    <el-table-column fixed="right" label="操作" min-width="120">
      <template #default="{ row }">
        <el-button link size="small" type="primary" @click="callParentMethod(row)">
          修改
        </el-button>
        <el-button link size="small" type="primary" @click="callParentdel(row.id)">删除</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script lang="ts" setup>
import { type RolesType } from '@/service/study5/demo2'

const { tableData } = defineProps<{
  tableData: RolesType[]
}>()

const emits = defineEmits(['updaterow', 'callParentdel'])

const callParentMethod = (row: any) => {
  emits('updaterow', row)
}

const callParentdel = (id: string) => {
  emits('callParentdel', id)
}
</script>

<style></style>
